package com.soft.javase.day02.practice.order;

/**
 * @author yzg
 * @desc TODO
 * @date 2025/4/16
 */
public class Test {
    public static void main(String[] args) {
        // 创建用户
        User user = new User("张三", "南京", "15566773456");

        // 创建商品
        Goods goods1 = new Goods("智能手机", 5999.0, 1, "最新款手机");
        Goods goods2 = new Goods("蓝牙耳机", 299.0, 1, "最新款耳机");
        Goods goods3 = new Goods("笔记本电脑", 8999.0, 1, "最新款电脑");

        // 用户下单
        user.placeOrder(10345678L, new Goods[]{goods1, goods3});
        user.placeOrder(23456789L, new Goods[]{goods3});

        // 查看订单详情
        Order[] orders = user.getOrders();
        for (int i = 0; i < orders.length; i++) {
            orders[i].viewGoodsDetails();
        }
    }
}
